
const Transitions = require('transitions');
const TransitionMaterials = require('transition-materials');

cc.Class({
    extends: cc.Component,

    properties: {
        transitions: Transitions  
    },

    // LIFE-CYCLE CALLBACKS:

    // onLoad () {},

    start () {

    },

    loadScene: function () {
        let random_index = orc.orc_utils.get_random(0,1);
        // console.log('random_index',random_index);
        let material = TransitionMaterials[random_index];
        if (material) {
            this.transitions.material = material;
        }
        
        let result = this.transitions.loadScene('game_main', 'Canvas/Main Camera', 'Canvas/Main Camera', this.onLoadSceneFinish.bind(this));
        if (!result) {
            return;
        }
    },

    onLoadSceneFinish: function () {        
        console.log('finish');
    },

    // update (dt) {},
});
